package com.kelvin.oocl.comparator;

import java.util.Comparator;

import com.kelvin.oocl.pojo.Customer;

public class CustomerIdComparator implements Comparator<Customer>{

	@Override
	public int compare(Customer o1, Customer o2) {
		int result = Integer.parseInt(o1.getId()) - Integer.parseInt(o2.getId());
		if(result==0){
			return o1.getName().compareTo(o2.getName());
		}else {
			return result;
		}
	}
	
}
